package com.example.thegreatwall.common;

import com.example.thegreatwall.controller.OrderController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Component
public class OverOrderListen {
    @Autowired
    OrderController orderController;

//    @Scheduled(cron = "0 * * * * ?")  // 每分钟的0秒触发
    public void executePerMinute() {
        System.out.println("这是一个时间测试: " + LocalDateTime.now());
        String s = orderController.overdueOrder();
        System.out.println(s);
    }

}
